<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="wilmar" uri="/wilmar-process"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<wilmar:process.head datatable="true" tooltip="true" />
<title><s:text name="page.title.pilist" /></title>
<script type="text/javascript">
	$(document)
			.ready(
					function() {
						$('#pilist')
								.dataTable(
										{
											"sPaginationType" : "full_numbers",
											"sDom" : '<"top"fi>rt<"bottom"lp<"clear">',
											"aaSorting" : [ [ 4, "desc" ] ],
											"bAutoWidth" : false,
											"oLanguage" : {
												"sLengthMenu" : "<s:text name='datatable.text.lengthmenu' />",
												"sZeroRecords" : "<s:text name='datatable.text.zerorecords' />",
												"sInfo" : "<s:text name='datatable.text.info' />",
												"sInfoEmtpy" : "<s:text name='datatable.text.infoemtpy' />",
												"sInfoFiltered" : "<s:text name='datatable.text.infofiltered' />",
												"sSearch" : "<s:text name='datatable.text.search' />",
												"oPaginate" : {
													"sFirst" : "<s:text name='datatable.text.frist' />",
													"sPrevious" : "<s:text name='datatable.text.previous' />",
													"sNext" : "<s:text name='datatable.text.next' />",
													"sLast" : "<s:text name='datatable.text.last' />"
												}
											}
										});
						$('#actions img[title]').tooltip('#common_tooltip');
					});
</script>
</head>
<body>
<center>
	<wilmar:process.logo></wilmar:process.logo>
</center>
<table id="pilist" cellpadding="0" cellspacing="0" border="0"
	width="100%">
	<thead>
		<tr align="center">
			<th><s:text name="table.title.process.instance.id" /></th>
			<th><s:text name="table.title.process.definition.name" /></th>
			<th><s:text name="table.title.process.instance.duration" /></th>
			<th><s:text name="table.title.process.instance.key" /></th>
			<th><s:text name="table.title.process.instance.starttime" /></th>
			<th><s:text name="table.title.process.instance.endtime" /></th>
			<th><s:text
				name="table.title.process.instance.currentactivitynames" /></th>
			<th><s:text name="table.title.actions" /></th>
		</tr>
	</thead>
	<tbody>
		<s:iterator value="%{historyProcessInstanceVOList}"
			id="historyProcessInstanceVOList" status="voList">
			<s:url id="stopInst" action="processInstanceAction"
				namespace="/process" method="doStopProcessInstance">
				<s:param name="processInformation.processInstanceId">
					<s:property value="processInstanceId" />
				</s:param>
			</s:url>
			<s:url id="imageUrl" action="processInstanceAction"
				namespace="/process" method="doInstanceImageForward">
				<s:param name="processInformation.processInstanceId">
					<s:property value="processInstanceId" />
				</s:param>
				<s:param name="processInformation.processDefinitionId">
					<s:property value="processDefinitionId" />
				</s:param>
			</s:url>
			<tr align="center">
				<td><s:property value="processInstanceId" /></td>
				<td><s:property value="processDefinitionName" /></td>
				<td><s:property value="duration" /></td>
				<td><s:property value="key" /></td>
				<td><s:property value="startTime" /></td>
				<td><s:property value="endTime" /></td>
				<td><s:if test="activityNames.isEmpty() == false">
					<s:property value="activityNames" />
				</s:if></td>
				<td>
				<div id="actions"><s:if test="stopAble == true">
					<s:a href="%{stopInst}">
						<wilmar:process.icon icon="stop" />
					</s:a>
				</s:if> <s:if test="suspendAble == true">
					<wilmar:process.icon icon="suspend_beta" width="39px" />
				</s:if> <s:if test="resumeAble == true">
					<wilmar:process.icon icon="reseum_beta" width="39px" />
				</s:if> <s:a href="%{imageUrl}">
					<wilmar:process.icon icon="image_beta" width="39px" />
				</s:a></div>
				</td>
			</tr>
		</s:iterator>
	</tbody>
</table>
<div id="common_tooltip">&nbsp;</div>
</body>
</html>